package weekMatch.one_341;

import java.util.Arrays;

public class LeeCode_01 {
    public static void main(String[] args) {

    }
    public int[] rowAndMaximumOnes(int[][] mat) {
        int maxRow = 0;
        int maxC = 0;
        int m = mat.length;
        int n = mat[0].length;
        for (int i = 0; i < m; i++) {
            int[] arr = mat[i];
            Arrays.sort(arr);
            int count = 0;
            for (int j : arr) {
                if (j == 1){
                    count++;
                }
            }
            if (count > maxC){
                maxC = count;
                maxRow = i;
            }
        }
        return new int[]{maxRow, maxC};
    }
}
